@extends('layout.admin')

@section('content')
<!-- 放一个表单 -->
<div class="mws-panel grid_8">
    <div class="mws-panel-header">
        <span>子版块修改</span>
    </div>
    <div class="mws-panel-body no-padding">
    <form class="mws-form" action="/session/update" method="post" enctype="multipart/form-data">
        @if(count($errors) > 0)
        <div class="mws-form-message warning">
            @foreach($errors->all() as $error)
                {{$error}}<br>
            @endforeach
        </div>
        @endif 

        <div class="mws-form-inline">

            <div class="mws-form-row">
                   
                <label class="mws-form-label">版块名称</label>
                <div class="mws-form-item">
                    <input class="small" type="text" name="sname" value="{{$sname->sname}}">
                </div>
            </div>
            <div class="mws-form-row">
                <label class="mws-form-label">图标</label>
                <div class="mws-form-item">
                    <img src="{{$sname->logo}}" width="200" alt="">
                  <input class="small" type="file" name="logo" value="{{$sname->logo}}">
                </div>
            </div>
           <div class="mws-form-row bordered">
            <label class="mws-form-label">版块介绍</label>
            <div class="mws-form-item">
                <textarea rows="" cols="" class="small" name="intro" value="{{$sname->intro}}">{{$sname->intro}}</textarea>
            </div>
        </div>
            <div class="mws-form-row">
                <label class="mws-form-label">状态</label>
                <div class="mws-form-item clearfix">
                    <ul class="mws-form-list inline">
                        <li><input type="radio" name="status" value="1" @if($sname->status == 1) checked @endif> <label>正常</label></li>
                        <li><input type="radio" name="status" value="0"  @if($sname->status == 0) checked @endif> <label>禁用</label></li>
                    </ul>
                </div>
            </div>
            
        </div>
        <div class="mws-button-row">
            <!-- 添加隐藏域 -->
            {{csrf_field()}}
            <input type="hidden" name="id" value="{{$sname->id}}">
            <input value="修改" class="btn btn-danger" type="submit">
            <input value="重置" class="btn " type="reset">
        </div>
    </form>
</div>      
</div>
@endsection